import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { SendModule } from './send/send.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BaseLogEntity } from '@/entity/base-log.entity';
import { SnakeCaseNamingStrategy } from '@/config/snake-case-naming-strategy';
import { ErrorEntity } from '@/entity/error.entity';
import { PaintEntity } from '@/entity/paint.entity';
import { TimingEntity } from '@/entity/timing.entity';
import { LongTaskEntity } from '@/entity/long-task.entity';

@Module({
  imports: [
    SendModule,
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: 'root',
      database: 'monitor_exception',
      entities: [
        BaseLogEntity,
        ErrorEntity,
        PaintEntity,
        TimingEntity,
        LongTaskEntity,
      ],
      namingStrategy: new SnakeCaseNamingStrategy(),
      logging: 'all',
      logger: 'advanced-console',
    })
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
